﻿#pragma once
#include "ChapterCollection.g.h"


namespace winrt::NovelReader::implementation
{
	struct ChapterCollection : ChapterCollectionT<ChapterCollection>
	{
		ChapterCollection() = default; 

		winrt::com_array<winrt::NovelReader::Chapter> ChaptersArray() const;
		void ChaptersArray(winrt::array_view<winrt::NovelReader::Chapter const> value);

		void Add(winrt::NovelReader::Chapter const& chapter); 
		void Add(winrt::hstring const& title, winrt::hstring const& text, int32_t index); 
		winrt::NovelReader::Chapter GetAt(int32_t index); 

		int32_t Size() const {return static_cast<int>(m_chaptersArray.size()); }
	private:
		std::vector<winrt::NovelReader::Chapter> m_chaptersArray; 
	};
}
namespace winrt::NovelReader::factory_implementation
{
	struct ChapterCollection : ChapterCollectionT<ChapterCollection, implementation::ChapterCollection>
	{
	};
}
